package com.model;
// default package

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;


/**
 * Proanswer entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name="db_proanswer"
    ,catalog="acmctgu"
)

public class Proanswer  implements java.io.Serializable {

    // Fields    

     private Integer id;
     private Programming programming;
     private Paper paper;
     private User user;
     private String answer;
     private Integer score;
     private Timestamp submittime;


    // Constructors

    /** default constructor */
    public Proanswer() {
    }

	/** minimal constructor */
    public Proanswer(Programming programming, Paper paper, User user, String answer) {
        this.programming = programming;
        this.paper = paper;
        this.user = user;
        this.answer = answer;
    }
    
    /** part constructor */
    public Proanswer(Programming programming, Paper paper, User user, String answer, Integer score) {
        this.programming = programming;
        this.paper = paper;
        this.user = user;
        this.answer = answer;
        this.score = score;
    }
    
    /** full constructor */
    public Proanswer(Programming programming, Paper paper, User user, String answer, Integer score, Timestamp submittime) {
        this.programming = programming;
        this.paper = paper;
        this.user = user;
        this.answer = answer;
        this.score = score;
        this.submittime = submittime;
    }

   
    // Property accessors

    @Id @GeneratedValue
    @Column(name="id", unique=true, nullable=false)

    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }
	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="programid", nullable=false)

    public Programming getProgramming() {
        return this.programming;
    }
    
    public void setProgramming(Programming programming) {
        this.programming = programming;
    }
	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="paperid", nullable=false)

    public Paper getPaper() {
        return this.paper;
    }
    
    public void setPaper(Paper paper) {
        this.paper = paper;
    }
	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="studentid", nullable=false)

    public User getUser() {
        return this.user;
    }
    
    public void setUser(User user) {
        this.user = user;
    }
    
    @Column(name="answer", nullable=false)

    public String getAnswer() {
        return this.answer;
    }
    
    public void setAnswer(String answer) {
        this.answer = answer;
    }
    
    @Column(name="score")

    public Integer getScore() {
        return this.score;
    }
    
    public void setScore(Integer score) {
        this.score = score;
    }
    
    @Column(name="submittime")

	public Timestamp getSubmittime() {
		return submittime;
	}

	public void setSubmittime(Timestamp submittime) {
		this.submittime = submittime;
	}
   








}